package com.init.iblog.controller;


import com.init.iblog.domain.ResponseResult;
import com.init.iblog.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@CrossOrigin
public class UploadController {

    @Autowired
    private UploadService uploadService;

    @PostMapping("/upload")
    public ResponseResult uploadImg(MultipartFile img){

        System.out.println("=========进入/upload接口测试");
        System.out.println("+++++++++++++前端传来的参数img："+img);
        return uploadService.uploadImg(img);
    }
}
